package com.tianmenguide.wxapi;

import com.tianmenguide.common.core.domain.AjaxResult;
import com.tianmenguide.guide.domain.Banners;
import com.tianmenguide.guide.domain.Introductions;
import com.tianmenguide.guide.service.IBannersService;
import com.tianmenguide.guide.service.IIntroductionsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/wxapi")
@RequiredArgsConstructor
@Api(tags = "介绍wxapi")
public class  WxIntroductionsController{

    private final IIntroductionsService introductionsService;

    @GetMapping("/loadIntroductions")
    @ApiOperation("查询介绍列表")
    public AjaxResult loadIntroductions(Introductions introductions){
        List<Introductions> introductionsList = introductionsService.selectIntroductionsList(introductions);
        return AjaxResult.success(introductionsList);
    }

    /**
     * 获取介绍信息管理详细信息
     */
    @ApiOperation("获取介绍信息管理详细信息")
    @GetMapping(value = "/loadIntroductions/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(introductionsService.selectIntroductionsById(id));
    }
}
